import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAuthModalStore = defineStore('authModal', () => {
  // 控制登录遮罩的显示状态
  const visible = ref(false)
  
  // 显示登录遮罩
  const showAuthModal = () => {
    visible.value = true
  }
  
  // 隐藏登录遮罩
  const hideAuthModal = () => {
    visible.value = false
  }
  
  // 切换登录遮罩显示状态
  const toggleAuthModal = () => {
    visible.value = !visible.value
  }
  
  return {
    visible,
    showAuthModal,
    hideAuthModal,
    toggleAuthModal
  }
})